package p270jp.pxv.android.advertisement.presentation.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.socdm.p087d.adgeneration.ADG;
import p062c4.ViewBindings;
import p064c6.Preconditions;
import p072ce.ViewRectangleAdSwitchBinding;
import p189gn.AbstractC3435a;
import p216hn.Lambda;
import p216hn.Reflection;
import p233ie.AdSwitchActionCreator;
import p233ie.AdSwitchStore;
import p270jp.pxv.android.R;
import p270jp.pxv.android.legacy.model.GoogleNg;
import p312le.C4665s;
import p312le.C4666t;
import p312le.MangaGridADGView;
import p312le.NovelNativeAdSwitchView;
import p325m0.MutabilityOwnership;
import p376no.Koin;
import p404oo.AbstractC5475a;
import p467rd.subscribers;
import p493sf.C6044d;
import p579vo.Qualifier;
import p579vo.StringQualifier;
import p603wm.AbstractC6949c;
import p645yc.AndroidSchedulers;
import p671zc.CompositeDisposable;
import p671zc.Disposable;

/* compiled from: RectangleAdSwitchView.kt */
/* renamed from: jp.pxv.android.advertisement.presentation.view.RectangleAdSwitchView */
/* loaded from: classes2.dex */
public final class RectangleAdSwitchView extends FrameLayout implements AbstractC5475a {

    /* renamed from: f */
    public static final /* synthetic */ int f18851f;

    /* renamed from: a */
    public final C6044d f18852a = new C6044d(null, 1);

    /* renamed from: b */
    public final AbstractC6949c f18853b = Preconditions.m9802P(1, new C4180a(this, null, null));

    /* renamed from: c */
    public final AbstractC6949c f18854c = Preconditions.m9802P(1, new C4181b(this, new StringQualifier("advertisement_module_ad_switch_action_creator_for_rectangle"), new NovelNativeAdSwitchView(this, 1)));

    /* renamed from: d */
    public final AbstractC6949c f18855d = Preconditions.m9802P(1, new C4182c(this, null, new MangaGridADGView(this, 2)));

    /* renamed from: e */
    public ViewRectangleAdSwitchBinding f18856e;

    /* compiled from: KoinComponent.kt */
    /* renamed from: jp.pxv.android.advertisement.presentation.view.RectangleAdSwitchView$a */
    /* loaded from: classes2.dex */
    public static final class C4180a extends Lambda implements AbstractC3435a<CompositeDisposable> {

        /* renamed from: a */
        public final /* synthetic */ AbstractC5475a f18857a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4180a(AbstractC5475a aVar, Qualifier aVar2, AbstractC3435a aVar3) {
            super(0);
            this.f18857a = aVar;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [zc.a, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final CompositeDisposable invoke() {
            return this.f18857a.getKoin().f24118a.m920a().m621a(Reflection.m5499a(CompositeDisposable.class), null, null);
        }
    }

    /* compiled from: KoinComponent.kt */
    /* renamed from: jp.pxv.android.advertisement.presentation.view.RectangleAdSwitchView$b */
    /* loaded from: classes2.dex */
    public static final class C4181b extends Lambda implements AbstractC3435a<AdSwitchActionCreator> {

        /* renamed from: a */
        public final /* synthetic */ AbstractC5475a f18858a;

        /* renamed from: b */
        public final /* synthetic */ Qualifier f18859b;

        /* renamed from: c */
        public final /* synthetic */ AbstractC3435a f18860c;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4181b(AbstractC5475a aVar, Qualifier aVar2, AbstractC3435a aVar3) {
            super(0);
            this.f18858a = aVar;
            this.f18859b = aVar2;
            this.f18860c = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [ie.b, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final AdSwitchActionCreator invoke() {
            Koin koin = this.f18858a.getKoin();
            return koin.f24118a.m920a().m621a(Reflection.m5499a(AdSwitchActionCreator.class), this.f18859b, this.f18860c);
        }
    }

    /* compiled from: KoinComponent.kt */
    /* renamed from: jp.pxv.android.advertisement.presentation.view.RectangleAdSwitchView$c */
    /* loaded from: classes2.dex */
    public static final class C4182c extends Lambda implements AbstractC3435a<AdSwitchStore> {

        /* renamed from: a */
        public final /* synthetic */ AbstractC5475a f18861a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f18862b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4182c(AbstractC5475a aVar, Qualifier aVar2, AbstractC3435a aVar3) {
            super(0);
            this.f18861a = aVar;
            this.f18862b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [ie.c, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final AdSwitchStore invoke() {
            Koin koin = this.f18861a.getKoin();
            return koin.f24118a.m920a().m621a(Reflection.m5499a(AdSwitchStore.class), null, this.f18862b);
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public RectangleAdSwitchView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        MutabilityOwnership.m3745m(context, "context");
        MutabilityOwnership.m3745m(attributeSet, "attributeSet");
        ViewDataBinding c = DataBindingUtil.m11370c(LayoutInflater.from(getContext()), R.layout.view_rectangle_ad_switch, this, true);
        MutabilityOwnership.m3746l(c, "inflate(LayoutInflater.f…le_ad_switch, this, true)");
        this.f18856e = (ViewRectangleAdSwitchBinding) c;
        Disposable g = subscribers.m2589g(getStore().f17473j.m986o(AndroidSchedulers.m334a()), null, null, new p312le.RectangleAdSwitchView(this), 3);
        CompositeDisposable disposables = getDisposables();
        MutabilityOwnership.m3744n(disposables, "compositeDisposable");
        disposables.mo82c(g);
        Disposable g2 = subscribers.m2589g(getStore().f17474k, null, null, new C4665s(this), 3);
        CompositeDisposable disposables2 = getDisposables();
        MutabilityOwnership.m3744n(disposables2, "compositeDisposable");
        disposables2.mo82c(g2);
        Disposable g3 = subscribers.m2589g(getStore().f17475l, null, null, new C4666t(this), 3);
        CompositeDisposable disposables3 = getDisposables();
        MutabilityOwnership.m3744n(disposables3, "compositeDisposable");
        disposables3.mo82c(g3);
    }

    /* renamed from: b */
    public static final void m4648b(RectangleAdSwitchView rectangleAdSwitchView) {
        rectangleAdSwitchView.f18856e.f5427s.setVisibility(0);
        rectangleAdSwitchView.f18856e.f5428t.setVisibility(0);
    }

    public final AdSwitchActionCreator getActionCreator() {
        return (AdSwitchActionCreator) this.f18854c.getValue();
    }

    private final CompositeDisposable getDisposables() {
        return (CompositeDisposable) this.f18853b.getValue();
    }

    private final AdSwitchStore getStore() {
        return (AdSwitchStore) this.f18855d.getValue();
    }

    /* renamed from: c */
    public void m4647c() {
        getActionCreator().m5153a();
    }

    /* renamed from: d */
    public void m4646d() {
        getActionCreator().m5153a();
        getStore().f17464a.m80f();
        getDisposables().m80f();
        ADG adg = this.f18856e.f5425q.f18846b;
        if (adg != null) {
            ViewBindings.m9831f(adg);
        }
        ADG adg2 = this.f18856e.f5426r.f18864b;
        if (adg2 != null) {
            ViewBindings.m9831f(adg2);
        }
        YufulightRectangleAdView yufulightRectangleAdView = this.f18856e.f5429u;
        yufulightRectangleAdView.f18875a.f5441q.setImageDrawable(null);
        yufulightRectangleAdView.f18875a.f5441q.setOnClickListener(null);
    }

    /* renamed from: e */
    public void m4645e() {
        getActionCreator().m5149e();
    }

    @Override // p404oo.AbstractC5475a
    public Koin getKoin() {
        return AbstractC5475a.C5476a.m3211a(this);
    }

    public void setGoogleNg(GoogleNg googleNg) {
        MutabilityOwnership.m3745m(googleNg, "googleNg");
        getActionCreator().m5150d(googleNg);
    }
}
